#include<iostream>
#include<vector>
using namespace std;

int main()
{
    vector<int> vec;
    for (int i = 0; i < 20;++i)
    {
        vec.push_back(rand() % 100 + 1);
    }
    vector<int>::iterator it = vec.begin();
    for (; it != vec.end();++it)
    {
        if(*it%2==0)
        {
            vec.erase(it);//erase删除当前的位置的迭代器
            // insert(it,val);在当前迭代器it上插入值为val
        }
    }
    return 0;
}